﻿<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title></title>
    <script src="~/js/frame.js"></script>
</head>
<body>
    <div class="container-fluid">
        <form id="form">
            <div class="formrow">
                <div class="col-xs-12">
                    <div class="formtitle required">连接名称</div>
                    <div class="formcontent">
                        <input name="ConfigName" type="text" class="form-control required" placeholder="">
                    </div>
                </div>
            </div>
            <div class="formrow">
                <div class="col-xs-12">
                    <div class="formtitle required">连接字符串</div>
                    <div class="formcontent">
                        <input name="ConfigConnectionString" type="text" class="form-control required" placeholder="">
                    </div>
                </div>
            </div>
            <div class="formrow">
                <div class="col-xs-12">
                    <div class="formtitle required">是否启用</div>
                    <div class="formcontent">
                        <label class="radio-inline">
                            <input type="radio" name="Enable" checked value="100">启用
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="Enable" value="200">禁用
                        </label>
                    </div>
                </div>
            </div>
            <div class="formrow">
                <div class="col-xs-12">
                    <div class="formtitle">备注</div>
                    <div class="formcontent">
                        <textarea name="ConfigInfo" class="form-control" rows="3" placeholder=""></textarea>
                    </div>
                </div>
            </div>
            <div class="formrow">
                <div class="col-xs-12">
                    <div class="formtitle">排序</div>
                    <div class="formcontent">
                        <input name="SortNum" type="text" class="form-control" placeholder="">
                    </div>
                </div>
            </div>
            <div class="formbtnop">
                <button class="btn btn-primary cloudbtn" type="button" onclick="Save()"><span class="btntext">保 存</span></button>
                <button class="btn cloudbtn" type="button" onclick="Close()"><span class="btntext">关 闭</span></button>
            </div>
        </form>
    </div>
    <script>
        var validator = $("#form").validate();
        $(function () {

        })
        function Save() {
            if (validator.form()) {
                var param = $("#form").GetForm();
                CloudPost(param, "opinsert", function (res) {
                    if (res.code == 0) {
                        OpenSuccess("保存成功！", function () {
                            CloseDialog();
                        })
                    } else {
                        OpenFail(res.data)
                    }
                })
            }
        }
        function Close() {
            CloseDialog();
        }
    </script>
</body>
</html>
